package com.qdlc.p2p.biz.processor.task;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.qdlc.p2p.biz.processor.event.BorrowValueEvent;
import com.qdlc.p2p.common.constant.TradeCode;
import com.qdlc.p2p.common.core.queue.QueueHandlers;
import com.qdlc.p2p.dal.dto.TppTradeLog;
import com.qdlc.p2p.dal.model.BorrowModel;

@Service
@Transactional
public class CollectionTradeNotifyAutoTenderTaskProcessor extends AbstractCollectionTradeNotifyTendeTaskProcessor {

	
	/**
	 * 支持的外部外部业务码
	 * @return
	 */
	public TradeCode tradeCode(){
		return TradeCode.C1001;
	}
	
	/**
	 * 代收成功后需要处理的逻辑
	 * 代收成功后需要调用代付接口，由子类完成
	 */
	protected void doPay(TppTradeLog tppTradeLog, BorrowModel bm){
		BorrowValueEvent borrowEvent = new BorrowValueEvent();
		borrowEvent.setBorrowModel(bm);
		borrowEvent.setTaskProcessorClass(TenderAutoTaskProcessor.class);
		QueueHandlers.put(borrowEvent);
	}
	
}
